#version 460 core

#include "../project_matrix.glsl"
#include "../vertOut.glsl"


layout(location = 1) out vec2 vUV;


vec2 pos[4] = {vec2(0.0, 0.0), vec2(1.0, 0.0), vec2(0.0, 1.0), vec2(1.0, 1.0)};
//vec2 pos[4] = {vec2(0.0, 0.0), vec2(100.0, 0.0), vec2(0.0, 100.0), vec2(100.0, 100.0)};
void main(void){
	mat3x2 mat = m_LP_SD[gl_InstanceIndex];


	vUV = pos[gl_VertexIndex];
	vec4 v = vec4(0.0, 0.0, 0.0, 1.0);
	//（顶点坐标*比例） + （大小*顶点权重）
	//v.xy = (pos[gl_VertexIndex] * mat[2].x) + mat[1];
	v.xy = pos[gl_VertexIndex] * mat[2].x + mat[1]*pos[gl_VertexIndex];
	
	
	v.xy += mat[0];
	v.xy *= m_Scale;
	v.xy += m_Loc;
	
	v.z = mat[2].y;
	gl_Position = mat_ProjecView * v;
	
	//gl_PointSize = 4.0;
}



